window: Handle attach widget disappearing without weak pointers
authorBenjamin Otte <otte@redhat.com>
Thu, 2 May 2013 14:26:37 +0000 (16:26 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 2 May 2013 14:26:37 +0000 (16:26 +0200)
Fixes the window not emitting a "notify::attached-to" signal when the
attach-widget goes away.

gtk/gtkwidget.c
gtk/gtkwindow.c

index 21369287384326f1da8fd7f944c40534f0207dc8..78fc44db3f9793bcd4725a4c029711f26029823b 100644 (file)
@@ -11052,8 +11052,8 @@ gtk_widget_dispose (GObject *object)
 
   g_clear_object (&priv->muxer);
 
-  g_list_free (priv->attached_windows);
-  priv->attached_windows = NULL;
+  while (priv->attached_windows)
+    gtk_window_set_attached_to (priv->attached_windows->data, NULL);
 
   G_OBJECT_CLASS (gtk_widget_parent_class)->dispose (object);
 }
index b6e3e15964f773790bae3591a0d44bdcda89328a..f32f63beefc789baa6ffd9d3be1626b62a259866 100644 (file)
@@ -2510,7 +2510,6 @@ remove_attach_widget (GtkWindow *window)
     {
       _gtk_widget_remove_attached_window (priv->attach_widget, window);
 
-      g_object_remove_weak_pointer (priv->attach_widget, &priv->attach_widget);
       priv->attach_widget = NULL;
     }
 }
@@ -2759,8 +2758,6 @@ gtk_window_set_attached_to (GtkWindow *window,
   if (priv->attach_widget)
     {
       _gtk_widget_add_attached_window (priv->attach_widget, window);
-
-      g_object_add_weak_pointer (priv->attach_widget, &priv->attach_widget);
     }
 
   /* Update the style, as the widget path might change. */